DAT210x - Programming with Python for DS

Module3 - Lab4


In [ ]:
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib

# This is new
from pandas.tools.plotting import parallel_coordinates

In [ ]:
# Look pretty...

# matplotlib.style.use('ggplot')
plt.style.use('ggplot')

Load up the wheat seeds dataset into a dataframe. We've stored a copy in the Datasets directory.


In [ ]:
# .. your code here ..

If you loaded the id column as a feature (hint: you shouldn't have!), then be sure to drop it. Also get rid of the area and perimeter features:


In [ ]:
# .. your code here ..

Plot a parallel coordinates chart grouped by the wheat_type feature. Set the optional display parameter alpha to 0.4:


In [ ]:
# .. your code here ..

Create a 2d scatter plot that graphs the compactness and width features:


In [ ]:
# Display the graphs:
plt.show()

In [ ]: